From: kaf24@firebug.cl.cam.ac.uk Date: Fri, 11 Mar 2005 17:10:51 +0000 (+0000) Subject: bitkeeper revision 1.1236.25.6 (4231d11bY0LPS6C3wJjBX-5Tagm2NA) X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~17857^2~26^2~15 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=deaaec59be2f80b0a6061bd305152c9c4ed92158;p=xen.git bitkeeper revision 1.1236.25.6 (4231d11bY0LPS6C3wJjBX-5Tagm2NA) Fix a couple of error paths. Use of domain_crash() probably needs auditing for safe use, and it may need to do things like forcibly release the per-domain BIGLOCK. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index c127c416f2..e07a31f4a3 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -2387,7 +2387,6 @@ void ptwr_flush(const int which) (L1_PAGETABLE_ENTRIES - i) * sizeof(l1_pgentry_t)); unmap_domain_mem(pl1e); ptwr_info[cpu].ptinfo[which].l1va = 0; - UNLOCK_BIGLOCK(d); domain_crash(); } diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 29dfc51881..60a8b74b75 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -1007,6 +1007,7 @@ long do_set_trap_table(trap_info_t *traps) { trap_info_t cur; trap_info_t *dst = current->arch.traps; + long rc = 0; LOCK_BIGLOCK(current->domain); @@ -1014,16 +1015,25 @@ long do_set_trap_table(trap_info_t *traps) { if ( hypercall_preempt_check() ) { - UNLOCK_BIGLOCK(current->domain); - return hypercall1_create_continuation( + rc = hypercall1_create_continuation( __HYPERVISOR_set_trap_table, traps); + break; } - if ( copy_from_user(&cur, traps, sizeof(cur)) ) return -EFAULT; + if ( copy_from_user(&cur, traps, sizeof(cur)) ) + { + rc = -EFAULT; + break; + } - if ( cur.address == 0 ) break; + if ( cur.address == 0 ) + break; - if ( !VALID_CODESEL(cur.cs) ) return -EPERM; + if ( !VALID_CODESEL(cur.cs) ) + { + rc = -EPERM; + break; + } memcpy(dst+cur.vector, &cur, sizeof(cur)); traps++; @@ -1031,7 +1041,7 @@ long do_set_trap_table(trap_info_t *traps) UNLOCK_BIGLOCK(current->domain); - return 0; + return rc; }